<template>
  <div>
    <Card class="margin-bottom">
      <p slot="title">用户管理</p>
      <data-table title="用户管理" :queryUrl="$api.getUserByPage" :addUrl="$api.addUser" :editUrl="$api.updateUser" :removeUrl="$api.removeUser" pageNumberParamer="page" pageSizeParamer="rowsPerPage" totalCountsKey='total' rowsKey="rows" :tableHeaders="tableHeaders"
        :addBtn="true" :editBtn="true" :removeBtn="true" removeKey="id" :searchBar="false" :editOption="editOption" :inBox="false"></data-table>
    </Card>
  </div>
</template>

<script>
  export default {
    name: "User",
    data() {
      return {
        editOption: {
          type: "get"
        },
        tableHeaders: [{
            title: "账号",
            key: "loginName",
            //该字段是否可添加和编辑
            editable: true,
            //该字段是否可搜索
            searchable: false
          },{
            title: "姓名",
            key: "name",
            //该字段是否可添加和编辑
            editable: true,
            //该字段是否可搜索
            searchable: false
          },
          {
            title: "部门id",
            key: "deptId",
            hidden:true,
            //该字段是否可添加和编辑
            editable: true,
            //该字段是否可搜索
            searchable: false
          },
          {
            title: "角色id",
            key: "gradeId",
            hidden:true,
            //该字段是否可添加和编辑
            editable: true,
            //该字段是否可搜索
            searchable: false
          },
          {
            title: "密码",
            key: "password",
            hidden:true,
            //该字段是否可添加和编辑
            editable: true,
            //该字段是否可搜索
            searchable: false
          },
          {
            title: "部门",
            key: "deptName",
            //该字段是否可添加和编辑
            editable: false,
            //该字段是否可搜索
            searchable: false
          },
          {
            title: "角色",
            key: "gradeName",
            //该字段是否可添加和编辑
            editable: false,
            //该字段是否可搜索
            searchable: false
          }
        ]
      };
    }
  };
</script>

<style scoped>

</style>